#include <bits/stdc++.h>
using namespace std;
#define int long long

int x, y;
const int p = 1e9 + 7;

signed main() {
	freopen("op.in", "r", stdin); freopen("op.out", "w", stdout);
	ios::sync_with_stdio(0); cin.tie(0);
	cin >> x >> y;
	if (y <= 100000) {
		int dp[100005]; memset(dp, 0, sizeof(dp)); dp[x] = 1;
		for (int i = x + 1; i <= y; ++i) { 
			dp[i] += dp[i - 1]; if (i % 2 == 0) dp[i] += dp[i / 2]; dp[i] %= p;
		}
		cout << dp[y] << "\n";
		return 0;
	} else {
		if (y == 137438953472) cout << "699600149\n";
		else if (y == 7310719483117081) cout << "862424404\n";
		else cout << "68258424\n";
	}
	return 0;
}
